package test {

import flash.utils.*;

import com.whirled.*;
import com.whirled.avrg.*;
import com.whirled.net.*;

import aduros.net.*;

public class Server extends ServerObject
{
    public function Server ()
    {
        _ctrl = new AVRServerGameControl(this);
        var self :Object = this;
        _provider = new RemoteProvider(_ctrl.game, null, function (... _) :Object {
            return self;
        });
    }

    public function log (msg :String) :void
    {
        trace(msg);
        _ctrl.game.sendMessage("log", msg);
    }

    REMOTE function oneArg (senderId :int, stuff :ByteArray) :void
    {
        log("Got oneArg: " + stuff.readInt());
    }

    REMOTE function sayHello (senderId :int, data :Data) :void
    {
        log("Got data from " + senderId + ": " + data.number + ", " + data.string);
    }

    REMOTE function woof (senderId :int) :void
    {
        log("WOOF!");
    }

    protected var _ctrl :AVRServerGameControl;
    protected var _provider :RemoteProvider;
}

}
